# -*- coding: utf-8 -*-
import re
import uuid

#将字符串只保留英文字符并全转为小写
def clean_and_lowercase(text):
  return re.sub(r'[^a-zA-Z]', '', text).lower()

def gen_unique_str(length = 16) -> str:
  if length <= 0:
    raise ValueError("length must be greater than 0")
  if length > 32:
    raise ValueError("length must be less than 32")
  unique_id = uuid.uuid4().hex
  return  unique_id[:length]
